#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Icon Helper Class
 *      Provides functions for working with icons in the Win32 API.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
using namespace System;
using namespace System::Drawing;
using namespace System::Runtime::InteropServices;

namespace Adaptive
{
	namespace Win32
	{
		/// <summary>
		/// Lists the icons in the standard Windows Shell32 library.
		/// </summary>
		public enum class ShellIcons
		{
			UnknownDocument  = 0,
			GenericDocument = 1,
			ConsoleApp = 2,
			Folder = 3,
			OpenFolder = 4,
			BigFloppy = 5,
			Floppy = 6,
			RamDrive = 7,
			HardDrive = 8,
			NetworkDrive = 9,
			DisconnectedNetworkDrive = 10,
			CDROM = 11,
			MemoryChip = 12,
			IePlanet = 13,
			MousePlanet = 14,
			PC = 15,
			Printer = 16,
			NetworkPC = 17,
			Network = 18,
			SystemFolder = 19,
			DateTimeDocument = 20,
			ControlPanelItem = 21,
			Search = 22,
			Help = 23,
			RunProgram = 24,
			Hibernate = 25,
			Power = 27,
			Hand = 28,
			Shortcut = 29,
			RecycleBin = 31,
			RecycleBinFull = 32,
			Telephony = 33,
			Desktop = 34,
			ControlPanel = 35,
			StartMenuFolder = 36,
			PrintersFolder = 37,
			FontsFolder = 38,
			StartMenu = 39,
			MusicCD = 40,
			Tree = 41,
			PCFolder = 42,
			Star = 43,
			Logoff = 44,
			SearchFolder = 45,
			WinPlanet = 46,
			Lock = 47
		};

		/// <summary>
		/// Provides functions for working with icons in the Win32 API.
		/// </summary>
		public ref class IconHelper sealed 
		{
		public:

			/*--------------------------------------------------------------------------------
	         * Public Methods / Functions
		     *------------------------------------------------------------------------------*/
			#pragma region Public Methods / Functions
			/// <summary>
			/// Gets the Windows related icon image for the specified file.
			/// </summary>
			/// <param name="fileName">A string that contains the path and file name. Both absolute and relative paths are valid.</param>
			/// <param name="selected">A value indicating whether to get the icon for a "selected" item.</param>
			/// <param name="smallIcon">A value indicating whether to get the small or large icon.</param>
			/// <returns>
			/// A <see cref="Icon"/> image.
			/// </returns>
			static Icon^ GetIcon(String^ fileName, bool selected, bool smallIcon);
			/// <summary>
			/// Translates the specified icon instance to a bitmap, with alpha blending.
			/// </summary>
			/// <param name="iconToTranslate">The <see cref="Icon"/> instance to be translated.</param>
			/// <returns>
			/// A <see cref="Bitmap"/> version of the specified icon image.
			/// </returns>
			static Bitmap^ IconToBitmap(Icon^ iconToTranslate);
			/// <summary>
			/// Gets a copy of the desktop icon.
			/// </summary>
			/// <returns>
			/// An <see cref="Icon"/> instance.
			/// </returns>
			static Icon^ DesktopIcon();
			/// <summary>
			/// Gets an icon to represent a folder.
			/// </summary>
			/// <param name="large">A value indicating whether to retrieve the large (32x32) icon.</param>
			/// <param name="selected">A value indicating whether to retrieve selected/open folder icon.</param>
			/// <returns>
			/// An <see cref="Icon"/> instance.
			/// </returns>
			static Icon^ GetShellFolderIcon(bool large, bool selected);
			/// <summary>
			/// Gets an icon from the Shell32 library.
			/// </summary>
			/// <param name="index">The index of the icon to retrieve.</param>
			/// <param name="large">A value indicating whether to retrieve the large (32x32) icon.</param>
			/// <returns>
			/// An <see cref="Icon"/> instance.
			/// </returns>
			static Icon^ GetShellIcon(int index, bool large);
	        #pragma endregion

		private:
			/*--------------------------------------------------------------------------------
			 * Constructor / Dispose / Destructor Methods
			 *------------------------------------------------------------------------------*/
			#pragma region Constructor / Dispose / Destructor Methods
			/// <summary>
			/// Initializes a new instance of the class.
			/// </summary>
			/// <remarks>
			/// This constructor is hidden to prevent instantiation.
			/// </remarks>
			IconHelper();
			#pragma endregion
		};
	}
}